package apt.action;

import java.util.List;

import apt.bean.NewsBean;
import apt.dao.NewsDao;

import com.opensymphony.xwork2.ActionSupport;

public class NewsAction extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private NewsBean newsBean;
	private NewsDao newsDao;
	private List<NewsBean> listNews;
	
	public NewsAction() {
		newsDao = new NewsDao();
	}
	
	public String getAllNews()
	{
		try {
			listNews = newsDao.getListNews();
		} catch (Exception e) {
			return ERROR;
		}
		return SUCCESS;
	}

	public NewsBean getNewsBean() {
		return newsBean;
	}

	public void setNewsBean(NewsBean newsBean) {
		this.newsBean = newsBean;
	}

	public NewsDao getNewsDao() {
		return newsDao;
	}

	public void setNewsDao(NewsDao newsDao) {
		this.newsDao = newsDao;
	}

	public List<NewsBean> getListNews() {
		return listNews;
	}

	public void setListNews(List<NewsBean> listNews) {
		this.listNews = listNews;
	}
	
	

}
